package com.example.app.components.MyBottomAppBar

import androidx.compose.foundation.layout.Column
import androidx.compose.foundation.layout.PaddingValues
import androidx.compose.foundation.layout.RowScope
import androidx.compose.foundation.layout.WindowInsets
import androidx.compose.foundation.layout.fillMaxWidth
import androidx.compose.foundation.layout.padding
import androidx.compose.material.AppBarDefaults
import androidx.compose.material3.BottomAppBar
import androidx.compose.material.MaterialTheme
import androidx.compose.material.contentColorFor
import androidx.compose.material.primarySurface
import androidx.compose.material3.BottomAppBarDefaults
import androidx.compose.material3.BottomAppBarScrollBehavior
import androidx.compose.material3.CenterAlignedTopAppBar
import androidx.compose.material3.ExperimentalMaterial3Api
import androidx.compose.runtime.Composable
import androidx.compose.ui.Modifier
import androidx.compose.ui.graphics.Color
import androidx.compose.ui.graphics.Shape
import androidx.compose.ui.unit.Dp
import androidx.compose.ui.unit.dp
import com.example.app.components.MyDivider.MyDivider
import com.example.app.components.MyDivider.MyDividerDirection
import com.example.app.ui.theme.listItemStartPadding

@OptIn(ExperimentalMaterial3Api::class)
@Composable
fun MyBottomAppBar(
        showDivider: Boolean = true,
        colModifier: Modifier = Modifier
            .padding(
                PaddingValues(
                    listItemStartPadding / 2,
                    0.dp
                )
            )
            .fillMaxWidth(),
        actions: @Composable RowScope.() -> Unit,
        modifier: Modifier = Modifier,
        floatingActionButton: @Composable (() -> Unit)? = null,
        containerColor: Color = BottomAppBarDefaults.containerColor,
        contentColor: Color = androidx.compose.material3.contentColorFor(containerColor),
        tonalElevation: Dp = BottomAppBarDefaults.ContainerElevation,
        contentPadding: PaddingValues = BottomAppBarDefaults.ContentPadding,
        windowInsets: WindowInsets = BottomAppBarDefaults.windowInsets,
        scrollBehavior: BottomAppBarScrollBehavior? = null,
) {
    Column(modifier = colModifier) {
        if (showDivider) {
            MyDivider(myDividerDirection = MyDividerDirection.HOR)
        }
        BottomAppBar(
            actions,
            modifier,
            floatingActionButton,
            containerColor,
            contentColor,
            tonalElevation,
            contentPadding,
            windowInsets,
            scrollBehavior,
        )


    }
}